package com.service.impl;

import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.PointGoodsMapper;
import com.entity.PointGoods;
import com.entity.view.ZhiyuanzheView;
import com.service.PointGoodsService;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class PointGoodsServiceImpl extends ServiceImpl<PointGoodsMapper, PointGoods> implements PointGoodsService {


    @Override
    public List<PointGoods> findByUserId(Integer userId) {
        return baseMapper.selectByUserId(userId);
    }

    @Override
    public PageUtils queryPage(Map<String, Object> params, Wrapper<PointGoods> wrapper) {
        Page<PointGoods> page =new Query<PointGoods>(params).getPage();
        page.setRecords(baseMapper.selectList(page,wrapper));
        PageUtils pageUtil = new PageUtils(page);
        return pageUtil;
    }
}
